﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" EnableEventValidation="false"
    ValidateRequest="false" AutoEventWireup="true" CodeFile="PurchaseManage.aspx.cs"
    Inherits="member_Trade_PurchaseManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="server">
    <script type="text/ecmascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
          function checkbox(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请选择需要永久删除的信息!");
            return false;
        }else
        {
           return confirm("确定要永久删除选中的信息吗？");
        }    
    }  
     </script>

    <form id="form1">
    <div id="lblmess" style="color:Red" runat="server"></div>
	  <div id="sub_content">
            <div class="pagetitle">
                管理供应信息</div>
            <div class="tishi">
            <div class="tishi_title"><span id="Htab_on2" onclick="document.getElementById('important_note').style.display=='block'||document.getElementById('important_note').style.display==''?document.getElementById('important_note').style.display='none':document.getElementById('important_note').style.display='block'; document.getElementById('Htab_on2').className=='Htab_on2'?document.getElementById('Htab_on2').className='Htab_off2':document.getElementById('Htab_on2').className='Htab_on2'"
                    style="cursor: hand">重要提醒</span></div>
            <p id="important_note" style=" margin: 5px 0;">
            1、"已过期"信息，网上将搜索不到！<br />
            2、请您务必确认您所发布的信息真实、合法、准确、及时，未侵犯他人合法权利，以免导致不必要的纠纷！<br />
            3、考虑到网站的整体利用效率，将对过期信息不定期的进行删除处理！如需继续推广，请及时重发信息！如不需要的过期信息，请及时删除！<br/>
            4、您的信息2小时内将发布上网,届时请上网查看。<br/>
            5、信息重发后到期时间将在当前时间的基础上增加10天！
        </p>
        <div class="clr"></div>
        </div>
            <div class="main_Supply_nav" >
                                
                <ul id="menu">
                    <li id="menu1" runat="server"><a href="PurchaseManage.aspx?Verify=1&class=MenuLiCheck">
                        已发布上网</a></li><li id="menu2" runat="server"><a href="PurchaseManage.aspx?Verify=3&class=MenuLiCheck">
                            审核中</a></li><li id="menu3" runat="server"><a href="PurchaseManage.aspx?Verify=2&class=MenuLiCheck">
                                审核未通过</a></li><li id="menu4" runat="server"><a href="PurchaseManage.aspx?Verify=4&class=MenuLiCheck">
                                    过期信息</a></li></ul>
            </div>
                        <asp:DataList ID="dlstPurchase" runat="server" RepeatColumns="1" DataKeyField="ID" CssClass="fl">
                            <ItemTemplate>
                              <table width="795" cellpadding="0" cellspacing="0" border="0" class="table_main1">
                          <tr  onmouseover="this.style.backgroundColor='#F6F6F6'" onmouseout="this.style.backgroundColor=''">
                            <td width="50" align="center"><asp:CheckBox ID="CheckBox1" runat="server" /></td>
                            <td width="120" align="center"><a href="/purchase/detail.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID")%>" class="table_photo" target="_blank"><asp:Image ID="Image1" runat="server" ImageUrl='<%# GetImageUrl(Eval("Thumbnail").ToString()) %>' width="80" Height="80" /></a></td>
                            <td width="250" align="center"> <a href="/purchase/detail.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID")%>" target="_blank">【求购】<%# DataBinder.Eval(Container.DataItem,"Name")%> </a></td>
                            <td align="center" width="243"><%# GetShortDate(DataBinder.Eval(Container.DataItem,"EndDate").ToString())%> </td>
                            <td align="center"><asp:LinkButton ID="xiugai" runat="server" Text="修改" Enabled="true" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>'
                                    OnCommand="xiugai_Command" /> </td>
                            <td align="center"><asp:LinkButton ID="chongfa" runat="server" Text="重发" Enabled="true" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>'
                                    OnCommand="BtnChongfa" /> </td>
                          </tr>
                        </table>
                            </ItemTemplate>
                            <HeaderTemplate>
                            <table width="795" height="30" cellpadding="0" cellspacing="0" class="table_main1">
                          <tr>
                            <td align="center" width="50" bgcolor="#EEEEEE"> <strong>选项</strong></td>
                            <td align="center" width="120" bgcolor="#EEEEEE"> <strong>图片</strong></td>
                            <td align="center" width="250" bgcolor="#EEEEEE"> <strong>信息类型</strong></td>
                            <td align="center" width="243" bgcolor="#EEEEEE"> <strong>到期时间</strong></td>
                            <td align="center" bgcolor="#EEEEEE"> <strong>操作</strong></td>
                          </tr>
                        </table>
                            </HeaderTemplate>
                        </asp:DataList>
                        <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="False"></asp:Label>
				<div class="paging" id="pldelete" runat="server">
				<p><asp:Label ID="Pagin" runat="server"></asp:Label></p>
				<input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
				<asp:Button ID="btnDelete" runat="server" OnClientClick="return checkbox();" Font-Size="9pt" OnClick="btnDelete_Click" Text="批量删除" CssClass="i_button" /> 
				</div>
				</div>
    </form>
</asp:Content>
